package com.dlwx.parttimetalent.views;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.dlwx.parttimetalent.R;
import com.dlwx.parttimetalent.comm.Constant;
import com.flyco.dialog.widget.base.BaseDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/11/21.
 */

public class IdentityDialog extends BaseDialog {

    @BindView(R.id.image_cancel)
    ImageView imageCancel;
    @BindView(R.id.image0)
    ImageView image0;
    @BindView(R.id.image1)
    ImageView image1;
    private Context context;
    private int type;

    public IdentityDialog(Context context,int type) {
        super(context);
        this.context = context;
        this.type=type;

    }

    @Override
    public View onCreateView() {
        View view = LayoutInflater.from(context).inflate(R.layout.dialog_identity, null);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void setUiBeforShow() {
        switch (type){
            case Constant.ZERO:
                image0.setImageResource(R.mipmap.icon_rzshenfena);
                image1.setImageResource(R.mipmap.icon_rzshenfenb);
                break;
            case Constant.ONE:
                image0.setImageResource(R.mipmap.icon_rzbiyezhenga);
                image1.setImageResource(R.mipmap.icon_rzbiyezhengb);
                break;
            case Constant.TWO:
                image0.setImageResource(R.mipmap.driver);
                image1.setImageResource(R.mipmap.driver1);
                break;
        }
    }

    @OnClick({R.id.image0, R.id.image1,R.id.image_cancel})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.image0:
                break;
            case R.id.image1:
                break;
            case R.id.image_cancel:
                this.dismiss();
                break;
        }
    }
}
